let Mock=require("mockjs");
let Random=Mock.Random;

module.exports=function(){
    let data={
        user:[],
        //用户
        userorder:[],
        //用户订单记录
        userintegral:[],
        //用户积分记录
        usergrowth:[],
        //用户成长值记录
        usercoupons:[],
        //用户优惠券
        GraphicCourse:[],
        //图文课程
        VideoCourse:[],
        //视频课程
        AudioCourse:[],
        admin:[],
        //管理员
        goods:[],
        //实物商品
        assets:[],

    }
    data.admin.push({
        id:1,
        account:Math.floor(Math.random()*1000000),
        username:Random.cname(2,3),
        userpwd:"123456",
        type:1,
        weixin:"core9",
        tel:Math.floor(Math.random()*10000000000),
        mail:String(Math.floor(Math.random()*100000))+"@163.com",
        qq:Math.floor(Math.random()*100000000),

    })
    for(let i=0;i<100;i++){
        let ID=Math.floor(Math.random()*10000000000);
        if(ID==0){
            ID=Math.floor(Math.random()*10000000000);
        }
        let gender;
        let tag;
        if(ID%2==0){
            gender="男"
            tag=["标签一"]
        }else{
            gender="女"
            tag=["标签二","标签三"]
        }
        data.assets.push({
            id:i,
            time:Random.date('yyyy-MM-dd hh:mm:ss'),
            paytype:"收入",
            amount:"660.00",
            billtype:"订单收入",
            balance:"5080.00",
            note:"西班牙语图文课程",
            number:Math.floor(Math.random()*100000)
        })
        let name=Random.cname(2,3);
        for(let j=i*30;j<30+i*30;j++){
            data.userintegral.push({
                uid:i,
                id:j,
                tradingTime:Random.date('yyyy-MM-dd hh:mm'),
                //交易时间
                beforeNum:2000,
                num:"+100",
                after:2100,
                why:"购买商品",
                note:"无"
            })
            data.usergrowth.push({
                uid:i,
                id:j,
                tradingTime:Random.date('yyyy-MM-dd hh:mm'),
                beforeNum:4000,
                num:"+100",
                after:4100,
                why:"APP签到",
                note:"无"
            })
            data.usercoupons.push({
                id:j,
                uid:i,
                time:Random.date('yyyy-MM-dd hh:mm'),
                name:"新人专享优惠券",
                denomination:10,
                channel:"APP领取",
                state:"未使用",
                note:"无"
            })
            data.userorder.push({
                id:j,
                uid:i,
                time:Random.date('yyyy-MM-dd hh:mm:ss'),
                number:Math.floor(Math.random()*10000000000),
                img:"https://www.pmdaniu.com/storages/127806/a2790bc912aee93deaaa4adce2900909-105941/images/%E7%B3%BB%E7%BB%9F%E9%A6%96%E9%A1%B5/u704.png",
                name:"西班牙语课程",
                price:400,
                num:1,
                pay:"微信支付",
                delivery:"无需配送",
                state:"已完成",
                payment:"400.00元"
            })
        }
        
        data.user.push({
            id:i,
            account:Math.floor(Math.random()*100000),
            //账号
            username:name,
            userpwd:"123456",
            tel:Math.floor(Math.random()*10000000000),
            gender,
            //等级
            age:Math.floor(Math.random()*100),
            weixin:"feker847",
            professional:"产品经理",
            //职业
            consignee:name,
            //常用收货人
            address:Random.city(true),
            source:"APP",
            //来源
            registerTime:Random.date('yyyy-MM-dd hh:mm'),
            loginTime:Random.date('yyyy-MM-dd hh:mm'),
            note:"无",
            //备注
            tags:tag,
            //标签
            integral:400,
            //积分
            growth:5200,
            //成长值
            viptype:Math.floor(Math.random()*6),
            //会员类型
            viplevel:Math.floor(Math.random()*100),
            //会员等级
            orderNum:Math.floor(Math.random()*100),
            //下单数量
            orderAmount:Math.floor(Math.random()*10000),
            //下单金额
            buyTime:Random.date('yyyy-MM-dd hh:mm:ss'),
            //消费时间
            todayStudyTime:3,
            //今日学习时长（h）,
            StudyTime:Math.floor(Math.random()*1000),
            //学习总时长
            course:6,
            //学习课程总数
            overCourse:1,
            //完成课程数量
            state:true,
            //用户状态
            touxiang:"https://www.pmdaniu.com/storages/127806/a2790bc912aee93deaaa4adce2900909-105941/images/%E7%94%A8%E6%88%B7%E6%9F%A5%E8%AF%A2/u4465.svg"
        })
        let time1=Random.date('yyyy-MM-dd');
        let time2=Random.date('yyyy-MM-dd');
        if(time1>time2){
            let t=time2;
            time2=time1;
            time1=t;
        };
        let classtype=1;
        if(ID%10==0||ID%10==1||ID%10==2){
            classtype=2;
            
        }else if(ID%10==3||ID%10==4||ID%10==5||ID%10==6){
            classtype==3;
        }else{
            classtype==1
        }
        data.goods.push({
            id:Math.floor(Math.random()*1000000),
            img:"https://www.pmdaniu.com/storages/127806/a2790bc912aee93deaaa4adce2900909-105941/images/%E5%95%86%E5%93%81%E7%AE%A1%E7%90%86/u3474.png",
            name:"Sony 降噪头戴式耳机",
            price:750,
            subscribe:300,
            //订阅量
            type:Math.floor(Math.random()*2),
            ShelfTime:time1,
            //上架时间
            shelvesTime:"2028-03-07",
            //下架时间
            xuid:Math.floor(Math.random()*1000),
            //排序号
            category:121,
            //分类
            classification:Random.cparagraph(4,6),
            num:Math.floor(Math.random()*10000),
            //库存
            type:classtype,
            //上架状态
            checked:false
        })
        
        data.VideoCourse.push({
            id:Math.floor(Math.random()*1000000),
            img:"https://www.pmdaniu.com/storages/127806/a2790bc912aee93deaaa4adce2900909-105941/images/%E9%9F%B3%E9%A2%91%E8%AF%BE%E7%A8%8B/u2391.png",
            name:"俄语视频课程",
            price:666,
            subscribe:300,
            //订阅量
            type:Math.floor(Math.random()*2),
            ShelfTime:time1,
            //上架时间
            shelvesTime:"2028-03-07",
            //下架时间
            xuid:Math.floor(Math.random()*1000),
            //排序号
            category:121,
            //分类
            classification:Random.cparagraph(4,6),
            num:Math.floor(Math.random()*10000),
            //库存
            type:classtype,
            //上架状态
            checked:false
        })
        data.AudioCourse.push({
            id:Math.floor(Math.random()*1000000),
            img:"https://www.pmdaniu.com/storages/127806/a2790bc912aee93deaaa4adce2900909-105941/images/%E8%A7%86%E9%A2%91%E8%AF%BE%E7%A8%8B/u1557.png",
            name:"法语音频课程",
            price:666,
            subscribe:300,
            //订阅量
            type:Math.floor(Math.random()*2),
            ShelfTime:time1,
            //上架时间
            shelvesTime:"2028-03-07",
            //下架时间
            xuid:Math.floor(Math.random()*1000),
            //排序号
            category:121,
            //分类
            classification:Random.cparagraph(4,6),
            num:Math.floor(Math.random()*10000),
            //库存
            type:classtype,
            //上架状态
            checked:false
        })
        data.GraphicCourse.push({
            id:Math.floor(Math.random()*1000000),
            img:"https://www.pmdaniu.com/storages/127806/a2790bc912aee93deaaa4adce2900909-105941/images/%E7%B3%BB%E7%BB%9F%E9%A6%96%E9%A1%B5/u704.png",

            name:"西班牙语课程",
            price:888,
            subscribe:300,
            //订阅量
            type:Math.floor(Math.random()*2),
            ShelfTime:time1,
            //上架时间
            shelvesTime:"2028-03-07",
            //下架时间
            xuid:Math.floor(Math.random()*1000),
            //排序号
            category:121,
            //分类
            classification:Random.cparagraph(4,6),
            num:Math.floor(Math.random()*10000),
            //库存
            type:classtype,
            //上架状态
            checked:false
        })
        
    }
    
    return data;
}